﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DualPlaneFR4Paster.Migrations
{
    public partial class changeMProductMPcs2ListMPcs : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_MProducts_MPcs_PcsId",
                table: "MProducts");

            migrationBuilder.DropIndex(
                name: "IX_MProducts_PcsId",
                table: "MProducts");

            migrationBuilder.DropColumn(
                name: "PcsId",
                table: "MProducts");

            migrationBuilder.AddColumn<int>(
                name: "MProductId",
                table: "MPcs",
                type: "INTEGER",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_MPcs_MProductId",
                table: "MPcs",
                column: "MProductId");

            migrationBuilder.AddForeignKey(
                name: "FK_MPcs_MProducts_MProductId",
                table: "MPcs",
                column: "MProductId",
                principalTable: "MProducts",
                principalColumn: "Id");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_MPcs_MProducts_MProductId",
                table: "MPcs");

            migrationBuilder.DropIndex(
                name: "IX_MPcs_MProductId",
                table: "MPcs");

            migrationBuilder.DropColumn(
                name: "MProductId",
                table: "MPcs");

            migrationBuilder.AddColumn<int>(
                name: "PcsId",
                table: "MProducts",
                type: "INTEGER",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_MProducts_PcsId",
                table: "MProducts",
                column: "PcsId");

            migrationBuilder.AddForeignKey(
                name: "FK_MProducts_MPcs_PcsId",
                table: "MProducts",
                column: "PcsId",
                principalTable: "MPcs",
                principalColumn: "Id");
        }
    }
}
